// 导入全局的css样式文件
import './assets/css/main.css'

import { createApp } from 'vue'
import App from './App.vue'

// 创建vue实例
const app = createApp(App)

import { createPinia } from 'pinia'
// 导入Pinia插件
import piniaPersist from 'pinia-plugin-persist'
// 创建Pinia存储
const pinia = createPinia()
pinia.use(piniaPersist)
app.use(pinia)

// 导入路由配置
import router from './router'
app.use(router)

// 导入Element-Plus
import ElementPlus from 'element-plus'
// 导入Element-Plus全局样式
import 'element-plus/dist/index.css'
app.use(ElementPlus)

// 注册Element-Plus所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// 必须放在Element-Plus导入之后
import 'virtual:windi.css'

app.mount('#app')